<template>
  <div class="rank">
    <div class="rank-list">
      <div class="rank-item" :class="'item-'+(index+1)" v-for="(item,index) in list" :key="index">
        <div class="num">0{{index+1}}</div>
        <div class="name">{{item.name}}<!--<div class="change iconfont" :class="item.rose?'icon-shangjiantou':'icon-xiajiantou'" :style="`color:${item.rose?'#0ce19f':'#e8554b'}`"></div>--></div>
        <div class="institutions-num">机构数量：{{item.value}}个</div>
      </div>
    </div>
  </div>
</template>

<script>
import {getInstitutionList} from "@/api/statistical2";

export default {
  name: "Ranking",
  data(){
    return{
      list:[
      ]
    }
  },
  methods:{
    getInstitution(){
      getInstitutionList().then(data=>{
        this.list=data;
      })
    },
  },
  mounted() {
    this.getInstitution();
  }
}
</script>

<style scoped lang="scss">
.rank{
  width: 100%;
  height: 100%;
  padding: 20px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  .rank-list{
    width: 100%;
    height: calc(100% - 60px);
    .rank-item{
      width: 100%;
      height: 35px;
      display: flex;
      align-items: center;
      margin-bottom: 10px;
      border-radius: 2px;
      .num{
        margin-left: 15px;
        width: 60px;
        color: #fff;
        font-size: 18px;
        font-weight: bold;
        display: flex;
        justify-content: center;
      }
      .name{
        margin-left: 10px;
        color: #fff;
        font-size: 14px;
        display: flex;
        align-items: center;
        width: 210px;
        .change{
          font-size: 12px;
          margin-left: 5px;
        }
      }
      .institutions-num{
        justify-self: flex-end;
        color: #fff;
        font-size: 14px;
        padding-left: 5px;
      }
    }
    .rank-item.item-1{
      background: url("~@/assets/images/statistical2/01.jpg") no-repeat center;
      background-size: 100% 100%;
    }
    .rank-item.item-2{
      background: url("~@/assets/images/statistical2/02.jpg") no-repeat center;
      background-size: 100% 100%;
    }
    .rank-item.item-3{
      background: url("~@/assets/images/statistical2/03.jpg") no-repeat center;
      background-size: 100% 100%;
    }
    .rank-item.item-4{
      background: url("~@/assets/images/statistical2/04.jpg") no-repeat center;
      background-size: 100% 100%;
    }
  }
}
</style>
